package com.sc.nft.admin.controller;





import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import com.sc.nft.annotation.SysMemberLogin;
import com.sc.nft.entity.DigitalCollection;
import com.sc.nft.entity.PackageRule;
import com.sc.nft.entity.dto.PackageAddDTO;
import com.sc.nft.entity.dto.ParticularsIdentityRightsAdminModificationDTO;
import com.sc.nft.entity.vo.GetDaoByIdVO;
import com.sc.nft.entity.vo.ParticularsIdentityRightsAdminVO;
import com.sc.nft.service.ParticularsIdentityRightsService;
import com.sc.nft.sup.ErrorCode;
import com.sc.nft.sup.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

/**
 * (ParticularsIdentityRights)表控制层
 *
 * @author 王伟成
 * @since 2024-03-09 15:04:02
 */

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/admin/particularsIdentityRights")
@Api(tags = "身份权益详情后台管理")
public class ParticularsIdentityRightsController {
    /**
     * 服务对象
     */
    private final ParticularsIdentityRightsService particularsIdentityRightsService;


    @PostMapping(value = "/list", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "获取列表", notes = "获取列表", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result<List<ParticularsIdentityRightsAdminVO>> list() {
        return Result.success(particularsIdentityRightsService.list());
    }

    @PostMapping(value = "/modification", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "修改图片", notes = "修改图片", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result modification(@Valid @RequestBody ParticularsIdentityRightsAdminModificationDTO request) {
        particularsIdentityRightsService.modification(request);
        return Result.success();
    }
}
